#!/bin/bash

# 创建10个窗口 5条流 5个发送 5个接收

# flow 1 1101-1102
# server
nohup docker exec s1102 bash -c "server --ip=192.168.11.2 --port=11102 --proto=17" > server_1102.out 2>&1 & echo $! > PID_SERVER_1
# client bandidth=25Mb
nohup docker exec s1101 bash -c "client-dstip=192.168.11.2 --dstport=11102  -t 2 -b 25000 -n 0" > client_1101_1.out 2>&1 & echo $! > PID_CLIENT_1

# flow 2 1101-1103
# server
nohup docker exec s1103 bash -c "server --ip=192.168.11.3 --port=11103 --proto=17" > server_1103.out 2>&1 & echo $! > PID_SERVER_3
# client bandidth=25Mb
nohup docker exec s1101 bash -c "client-dstip=192.168.11.3 --dstport=11103  -t 2 -b 25000 -n 0" client_1101_2.out 2>&1 & echo $! > PID_CLIENT_3

# flow 3 1101-1104
# server
nohup docker exec s1104 bash -c "server --ip=192.168.11.4 --port=11104 --proto=17" > server_1104.out 2>&1 & echo $! > PID_SERVER_4
# client bandidth=25Mb
nohup docker exec s1101 bash -c "client-dstip=192.168.11.4 --dstport=11104  -t 2 -b 25000 -n 0" client_1101_3.out 2>&1 & echo $! > PID_CLIENT_4

# flow 4 1101-1105
# server
nohup docker exec s1105 bash -c "server --ip=192.168.11.5 --port=11105 --proto=17" > server_1105.out 2>&1 & echo $! > PID_SERVER_5
# client bandidth=25Mb
nohup docker exec s1101 bash -c "client-dstip=192.168.11.5 --dstport=11105  -t 2 -b 25000 -n 0" client_1101_4.out 2>&1 & echo $! > PID_CLIENT_5

# flow 5 1101-1106
# server
nohup docker exec s1106 bash -c "server --ip=192.168.11.6 --port=11106 --proto=17" > server_1106.out 2>&1 & echo $! > PID_SERVER_6
# client bandidth=25Mb
nohup docker exec s1101 bash -c "client-dstip=192.168.11.6 --dstport=11106  -t 2 -b 25000 -n 0" client_1101_5.out 2>&1 & echo $! > PID_CLIENT_6



# flow1
# server
docker exec -it s1102 bash
server --ip=192.168.11.2 --port=11102 --proto=17
# client
docker exec -it s1101 bash
client --srcip=192.168.11.1 --dstip=192.168.11.2 --dstport=11102 -t 2 -b 25000 -s 1400 -n 0

# flow2
# server
docker exec -it s1103 bash
server --ip=192.168.11.3 --port=11103 --proto=17
# client
docker exec -it s1101 bash
client --srcip=192.168.11.1 --dstip=192.168.11.3 --dstport=11103 -t 2 -b 25000 -s 1400 -n 0

# flow3
# server
docker exec -it s1104 bash
server --ip=192.168.11.4 --port=11104 --proto=17
# client
docker exec -it s1101 bash
client --srcip=192.168.11.1 --dstip=192.168.11.4 --dstport=11104 -t 2 -b 25000 -s 1400 -n 0

# flow4
# server
docker exec -it s1105 bash
server --ip=192.168.11.5 --port=11105 --proto=17
# client
docker exec -it s1101 bash
client --srcip=192.168.11.1 --dstip=192.168.11.5 --dstport=11105 -t 2 -b 25000 -s 1400 -n 0

# flow5
# server
docker exec -it s1106 bash
server --ip=192.168.11.6 --port=11106 --proto=17
# client
docker exec -it s1101 bash
client --srcip=192.168.11.1 --dstip=192.168.11.6 --dstport=11106 -t 2 -b 30000 -s 1400 -n 0


docker exec s1106 bash -c server --ip=192.168.11.6 --port=11106 > ~/logfile/server/s1106.log 2>&1 &
docker exec s1101 bash -c client --srcip=192.168.11.1 --dstip=192.168.11.6 --dstport=11106 -n 0 -t 2 -s 1400 -b 25000  > /dev/null 2>&1 &